var gulp = require('gulp'),
    less = require('gulp-less'),
    minify = require('gulp-clean-css'),
    rename = require('gulp-rename'),
    concat = require('gulp-concat'),
    uglify = require('gulp-uglify');

gulp.task('less', function() {
    gulp.src('less/mui.less')
        .pipe(less())
        .pipe(gulp.dest('css'));
});

gulp.task('less-watch', function() {
    gulp.watch('less/**/*.less', ['less']);
});

gulp.task('css', function() {
    gulp.src('less/mui.less')
        .pipe(less())
        .pipe(rename('mui.min.css'))
        .pipe(minify())
        .pipe(gulp.dest('dist'));
    // gulp.src('less/mui-blue.less')
    //     .pipe(less())
    //     .pipe(rename('mui-blue.min.css'))
    //     .pipe(minify())
    //     .pipe(gulp.dest('dist'));
    // gulp.src('less/mui-purple.less')
    //     .pipe(less())
    //     .pipe(rename('mui-purple.min.css'))
    //     .pipe(minify())
    //     .pipe(gulp.dest('dist'));
});

gulp.task('js', function() {
    gulp.src('./js/*.js')
        .pipe(concat('mui.min.js'))
        .pipe(uglify())
        .pipe(gulp.dest('dist'));
});

gulp.task('default', ['css', 'js']);